// 页面路径：store/index.js 
import Vue from 'vue'
import Vuex from 'vuex'

// 导入state对象（储存器）
import state from "./state.js"

//vue的插件机制
Vue.use(Vuex);

//Vuex.Store 构造器选项
// const store = new Vuex.Store({
// 	state: {
// 		vuex_theme: uni.getStorageSync('vuex_theme') ? uni.getStorageSync('vuex_theme') : 'light'
// 	},
// 	mutations: {
// 		changeTheme(state, theme) {
// 			state.vuex_theme = theme;
// 			uni.setStorageSync('vuex_theme', theme);
// 		}
// 	}
// })

// export default store

export default new Vuex.Store({
  state: {
    curThemeType: 'light',
  },
  mutations: {
    setCurThemeType(state, data) {
      state.curThemeType = data;
    }
  },
  actions: {
    handleActionAgree({ commit }, boo) {
      commit('handleAgree', boo);
    }
  },
  getters: {
    themeType(state) {
      return state.curThemeType;
    }
  }
  // modules: {},
  })